#pragma once
#include "stdafx.h"

typedef struct Vertex
{
	float m_fx,m_fy,m_fz;
	COLORREF m_Color;
	bool m_bSelected;
	float m_fSize;
	bool m_bVisible;

	Vertex()
	{}

	Vertex(float fx,float fy,float fz,COLORREF color,bool bSelected,float fSize,bool bVisible)
	{
		m_fx = fx;
		m_fy = fy;
		m_fz = fz;
		m_Color = color;
		m_bSelected = bSelected;
		m_fSize = fSize;
		m_bVisible = bVisible;
	}	
}Vertex,* PVertex;

typedef struct tagTriangle
{
	PVertex m_pV1,m_pV2,m_pV3;
	tagTriangle *m_pPrev,*m_pNext;
	bool m_bVisible;
}Triangle,*PTriangle;

typedef struct tagMesh
{
	list<Vertex>* m_pVertex;
	PTriangle m_pTriangle;
}Mesh,* PMesh;


int IsCounterClockWise(const Vertex& v1,const Vertex& v2,const Vertex& v3);
int IsInTriangle(const Triangle& tri,const Vertex& v);
int IsInCircle(const Vertex& va,const Vertex& vb,const Vertex& vp,const Vertex& vd); 


typedef list<Vertex>::iterator IterVertex;
typedef list<Triangle>::iterator IterTriangle;